package com.example.a001.part16;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;

import com.example.a001.R;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4); // 修正为正确的布局文件

        PasswordInputView passwordInputView = findViewById(R.id.passwordInputView);
        Button button = findViewById(R.id.button);

        button.setOnClickListener(v -> {
            String input = passwordInputView.getText().toString().trim();
            Toast.makeText(this, "密码：" + input, Toast.LENGTH_SHORT).show();
        });
    }
}
